home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
pcpil
/
sample11.pil
< prev
next >
Wrap
Text File
|
1979-12-31
|
3KB
|
126 lines
TS:M2
T:Student restart example.
:
:Each time you run this program you are asked for a 9-digit ID
:number. You can leave the program at any time by pushing the ESC
:key. When you run again with the same ID number you are
:restarted at the place you left off.
:
:This is accomplished by saving a restart indicator along with
:each ID number in the file SAMPLE11.REC. After you run this program
:with various ID numbers, stopping at various sections, you can look
:at the restart file by the command TYPE SAMPLE11.REC
:
R: record layout: REC$(1,9 ) = student id number
R: REC$(10,1) = a blank character
R: REC$(11,2) = section number at which to restart next time
R: REC$(13,2) = RETURN and LINE-FEED characters
R: next variable, RECZ, is the length of each record .
C: RECZ = 14
D: ID$(9), REC$(RECZ)
R:Determine students identity.
T:
*IDNO
T:Please enter your 9-digit ID number:
A:$ID$
J(LEN(%B)<7):IDNO
R: See if student already on file by reading through the file SAMPLE11.REC
FX:SAMPLE11.REC
C: RECNO = 0
*FIND
FI:RECNO*RECZ,REC$
J(ASC(REC$) = 255):EOF
J(ID$ = REC$(1,9)):FOUND
C:RECNO = RECNO+1
J:FIND
*EOF T:That student ID is not on file.
*EOF1
T:
: Enter Q to QUIT right now
: or S to START running the program
:
A:
M:Q!q
EY:
M:S!s
JN:EOF1
C:PART = 1
T:
T:There are 4 sections in this program. You will start at section #PART.
J: GO
*FOUND
C:PART = REC$(11,2)
T(PART >= 5):You have previously completed all sections.
EC:
T:You left off at section #PART. We can restart at that piont.
R:Enable ESCAPE option, then go to appropriate section.
*GO P:E
W:40
X: "J:SECT" !! PART
R: Come here if student pushes ESC at any time indicating he wishes to leave.
*SYSX
T:Program interupted...
T:Next time you run the program you will start at section #PART.
*DONE
C: REC$(1,9) = ID$
C: REC$(11,2) = PART
C: REC$(13,2) = CHR(13) !! CHR(10)
FO:RECNO*RECZ,REC$
FX:
*EXIT E:*EXIT
*SECT1
TX:Section 1
:push Enter to go on to the next section,
:or push ESC to stop at this point.
A:
T:Section 1 completed.
W:20
C:PART = 2
*SECT2
TX:Section 2
:push Enter to go on to the next section,
:or push ESC to stop at this point.
A:
T:Section 2 completed.
W:20
C:PART = 3
*SECT3
TX:Section 3
:push Enter to go on to the next section,
:or push ESC to stop at this point.
A:
T:Section 3 completed.
W:20
C:PART = 4
*SECT4
TX:Section 4
:push Enter to go on to the next section,
:or push ESC to stop at this point.
A:
T:Section 4 completed.
W:20
C:PART = 5
TX:All sections completed.
W:20
J:DONE